<template>
	<view>
		<view>
		<view class="smart-container"> 1. 容器</view>
		<view class="smart-panel-h" @click="goDetailPage('view')" >
			<text>view视图</text>
			
			</view>
			<view class="smart-panel-h" @click="goComponents('go')" >
				<text>组件页</text>
				
				</view>
		<view class="smart-container" @click="goDetailPage('scroll-view')">
			<text>2.基础内容</text>
			</view>
	<view class="smart-panle-h " @click="goDetailPage('swiper')">
		<text>text文本编辑</text>
		</view>
		<view class="smart-panle-h " @click="goDetailPage('icon')">
			<text>icon图标</text>
			</view>
			<!-- 表单组件 -->
		<view class="smart-container ">
			<text>3.表单组件</text>
			</view>
			<view class="smart-panle-h " @click="goDetailPage('botton')">
				<text>button按钮</text>
				</view>
			<view class="smart-panle-h "@click="goDetailPage('checkbox')" >
				<text>checkbox 多选框</text>
				</view>
			<view class="smart-panle-h "@click="goDetailPage('label')" >
				<text>label标签组件</text>
				</view>
				<view class="smart-panle-h" @click="goDetailPage('input')">
					<text>input输入框</text>
					</view>
			<view class="smart-panle-h "@click="goDetailPage('textarea')">
				<text>textarea多行文本输入框</text>
				</view>
				<view class="smart-panle-h "@click="goDetailPage('form')" >
					<text>form表单</text>
					</view>
					<view class="smart-container ">
						<text>4.导航组件</text>
						</view>
						<view class="smart-panle-h "@click="goDetailPage('nevigator')" >
							<text>nevigator</text>
							</view>
      </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				account:null

			}
		},
		onShow() {
			console.log("组件页 Onshow");
			uni.getStorage({
				key:'UserName',
				success() {
					console.log("获取字段成功 " +JSON.stringify(result));
					this.account = result.data;
				},
				fail(errMsg) {
					//[object Object]
					console.log("获取字段失败 " +JSON.stringify(errMsg));
				}
			})
		},
		methods: {
			goComponents() {
			  uni.navigateTo({
			    url: '/pages/CustomPage/CustomPage' 
			  })
			},
		goDetailPage(e) {
				if (typeof e === 'string') {
					uni.navigateTo({
						url: '/pages/components/' +e+ '/'+e
					});
				} else {
					uni.navigateTo({
						url:e.url
					});
				}
			}
		}
	}
</script>

<style>
.smart-innel-panel{
	background-color: #8f8f94;
	flex-direction: row;
	align-items: center;
	padding: 12px;
	margin-bottom: 2px;
}
.smart-container{
	background-color: #aee5ae;
		flex-direction: row;
		align-items: center;
		padding: 12px;
		margin-bottom: 2px;
	
}
.smart-panle-h{
	background-color: #ffffff;
		flex-direction: row;
		align-items: center;
		padding: 5px;
		margin-bottom: 2px;
}
</style>